#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QPainter>
#include <QPaintEvent>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QMouseEvent>
#include <QSettings>
#include "gamewindow.h"
#include "gamewindow2.h"
#include"gamewindow3.h"
#include "gamewindow4.h"


QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

protected:
        void paintEvent(QPaintEvent *event)override;//背景图片

private:
        QMediaPlayer *player;
    QAudioOutput *audioOutPut;
        void playBackGroundMusic(const QString &filepath);//播放音乐
    void muteMusic();
     void unmuteMusic();

private:
    QPushButton *button1;
    GameWindow *gameWindow;
    QPushButton *button2;
    GameWindow2 *gameWindow2;
    QPushButton *button3;
    GameWindow3 *gameWindow3;
    QPushButton *button4;
    GameWindow4 *gameWindow4;//创建四个按钮

private slots:
    void openGameWindow1();
    void openGameWindow2();
    void openGameWindow3();
    void openGameWindow4();
    void resizeEvent(QResizeEvent *event)override;
 //按钮们的槽,且添加了自适应窗口的resize




private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
